﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:props="clr-namespace:ScrumFactory.Windows.Properties"
                    xmlns:SF_Helpers="clr-namespace:ScrumFactory.Windows.Helpers;assembly=ScrumFactory.Windows.Helpers"
                    xmlns:SF_Ext="clr-namespace:ScrumFactory.Windows.Helpers.Extensions;assembly=ScrumFactory.Windows.Helpers"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib">


  

    <Style x:Key="MouseOverBorder" TargetType="{x:Type Border}">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="CornerRadius" Value="4"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="Border.IsMouseOver" Value="True">
                <Setter Property="Border.Background" Value="{StaticResource MouseOverBackgroundBrush}"/>
                <Setter Property="Border.BorderBrush" Value="{StaticResource MouseOverBorderBrush}"/>
                <Setter Property="TextBlock.Foreground" Value="{StaticResource MouseOverForegroundBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MouseOverListBorder" TargetType="{x:Type Border}">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="CornerRadius" Value="4"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="Border.IsMouseOver" Value="True">
                <Setter Property="Border.Background" Value="{StaticResource MouseOverListBackgroundBrush}"/>
                <Setter Property="Border.BorderBrush" Value="{StaticResource MouseOverListBorderBrush}"/>                
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MemberImageControlStyle" TargetType="{x:Type ContentControl}">
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="50"/>        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <Image                         
                            Margin="3"
                            Source="/Images/ToolBar/Contact_Book.png" Width="32" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Image.Style>
                                <Style>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContactMember}" Value="False">
                                            <Setter Property="Image.Visibility" Value="Collapsed"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>
                        </Image>
                        <Border CornerRadius="0"   BorderThickness="1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                       
                            <Image 
                                Margin="3"                                
                                SF_Ext:ImageAsyncHelper.SourceUri="{Binding MemberAvatarUrl}"                                
                                Width="{TemplateBinding ActualWidth}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Border.Style>
                                <Style>
                                    <Setter Property="Border.Background" Value="{StaticResource MemberTodayPlannedBrush}"/>
                                    <Setter Property="Border.BorderBrush" Value="{StaticResource MemberTodayPlannedBorderBrush}"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContactMember}" Value="True">
                                            <Setter Property="Border.Visibility" Value="Collapsed"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding TodayMemberPlannedHours}" Value="{x:Null}">
                                            <Setter Property="Border.Background" Value="{StaticResource MemberTodayPlannedNullBrush}"/>
                                            <Setter Property="Border.BorderBrush" Value="{StaticResource MemberTodayPlannedNullBorderBrush}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsTodayOverPlanned}" Value="True">
                                            <Setter Property="Border.Background" Value="{StaticResource MemberTodayOverPlannedBrush}"/>
                                            <Setter Property="Border.BorderBrush" Value="{StaticResource MemberTodayOverPlannedBorderBrush}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsTodayHalfPlanned}" Value="True">
                                            <Setter Property="Border.Background" Value="{StaticResource MemberTodayHalfPlannedBrush}"/>
                                            <Setter Property="Border.BorderBrush" Value="{StaticResource MemberTodayHalfPlannedBorderBrush}"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                        </Border>
                    </Grid>
                    
                    
                  
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
   


    <Style x:Key="LoadingAnimationContent" TargetType="{x:Type ContentControl}" PresentationOptions:Freeze="True">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">            
            <Setter.Value>
                <ControlTemplate>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">                        
                        <Image
                            Source="/Images/LogoLoading.png"                
                            Stretch="None"
                            ToolTip="{x:Static props:Resources.Loading}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                            <Image.RenderTransform>
                                <ScaleTransform ScaleX="1" ScaleY="1" CenterX="0.5" CenterY="0.5"/>
                            </Image.RenderTransform>
                            <Image.Triggers>
                                <EventTrigger RoutedEvent="Image.Loaded">
                                    <EventTrigger.Actions>
                                        <BeginStoryboard>
                                            <Storyboard AutoReverse="True" RepeatBehavior="Forever" >
                                                <DoubleAnimation                                                                        
                                                Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)"                                               
                                                To="0.8"
                                                Duration="00:00:0.2"
                                                PresentationOptions:Freeze="True"/>
                                                <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)"
                                                To="0.8"
                                                Duration="00:00:0.2"
                                                PresentationOptions:Freeze="True"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </EventTrigger.Actions>
                                </EventTrigger>
                            </Image.Triggers>
                        </Image>                        
                    </Grid>
                </ControlTemplate>
            
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsLoadingData}" Value="True">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
   
 

    <Style TargetType="{x:Type SF_Helpers:DockWindowContainer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type SF_Helpers:DockWindowContainer}">
                    <ScrollViewer
                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                            x:Name="windowScrollViewer_PART"                                                       
                            VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">
                        <Grid x:Name="contentGrid_PART">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter
                                        Grid.Column="0"
                                        x:Name="mainContent_PART"
                                        Content="{TemplateBinding Content}"/>
                            <SF_Helpers:ScrollViewerOffsetMediator
                                    x:Name="Mediator_PART"            
                                    ScrollViewer="{Binding ElementName=windowScrollViewer_PART}"/>
                        </Grid>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type GridSplitter}">
        <Setter Property="Background" Value="{StaticResource DockPanelSplitterBackground}"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect Opacity="0.3" />
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>       
    </Style>

    <Style x:Key="AlertBorder" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="{StaticResource AlertBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource AlertBrush}"/>
        <Setter Property="TextBlock.Foreground" Value="{StaticResource AlertBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="Padding" Value="4"/>
    </Style>

    <Style x:Key="ToolBarInsideBorder" TargetType="{x:Type Border}">
        <Setter Property="Margin" Value="0,0,5,0"/>
        <Setter Property="CornerRadius" Value="3"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Gray1Color}" />
            </Setter.Value>
        </Setter> 
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Green1Color}" Opacity="0.2"/>
            </Setter.Value>
        </Setter>
    </Style>

   


    <Style x:Key="ItemActionMenu" TargetType="{x:Type DockPanel}">
        <Setter Property="DockPanel.Visibility" Value="Collapsed"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Margin" Value="0,3,3,0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListViewItem}}}" Value="True">
                <Setter Property="DockPanel.Visibility" Value="Visible"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True">
                <Setter Property="DockPanel.Visibility" Value="Visible"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="PostItBorder" TargetType="{x:Type Border}">
        <Setter Property="CornerRadius" Value="4"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Background" Value="{StaticResource PostItBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PostItBorderBrush}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Task.TaskType}" Value="3">
                <Setter Property="Background" Value="{StaticResource PostItImpedimentBackground}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PostItImpedimentBorderBrush}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="NewItemPanel" TargetType="DockPanel">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Height" Value="0"/>
        <Style.Triggers>
            <EventTrigger RoutedEvent="GotFocus">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Height" To="50" Duration="00:00:00.2" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
          
        </Style.Triggers>
    </Style>


    <Style x:Key="NewItemPanelAutoClose" TargetType="DockPanel" BasedOn="{StaticResource NewItemPanel}">                
        <Style.Triggers>
            <EventTrigger RoutedEvent="LostKeyboardFocus">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Height" To="0" Duration="00:00:00.3" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>            
        </Style.Triggers>
    </Style>

    
</ResourceDictionary>
    
    
    